/*
 * VarReference.cpp
 *
 *  Created on: 15.04.2012
 *      Author: Eugene Kornykhin
 */

#include "VarReference.h"

VarReference::VarReference(string var)
: var(var) {
}

VarReference::~VarReference() {

}

string VarReference::getVar() const {
	return var;
}

void VarReference::execute(Interpreter& interpreter) {
	interpreter.pushPolizElement(*this);
}

PolizPosition VarReference::next_position_after(PolizPosition p) const {
	return p.next();
}

bool VarReference::isHalt() const {
	return false;
}

VarReference* VarReference::clone(const Poliz &) const {
	return new VarReference(var);
}

string VarReference::toString() const {
	return "[REF TO " + var + "]";
}

